// test_chroma.js
const { ChromaClient } = require("chromadb");

async function testChroma() {
  const client = new ChromaClient({
    path: "http://localhost:8000", // ChromaDB 服务器地址
  });

  try {
    // 测试连接
    const heartbeat = await client.heartbeat();
    console.log("ChromaDB 连接成功！");
    console.log("Heartbeat:", heartbeat);

    // 列出所有集合
    const collections = await client.listCollections();
    console.log("Collections:", collections);
  } catch (error) {
    console.error("连接 ChromaDB 失败:", error.message);
  }
}

testChroma();
